//package com.springboot.demo.common.config.security;
//
//import com.springboot.demo.dao.UserDao;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//
///**
// *.自定义权限认证服务层
// */
//public class CustomUserService implements UserDetailsService{
//
//    @Autowired
//    private UserDao userDao;
//
//    @Override
//    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
////        User user = userDao.findByLogin(s);
////        if(user == null){
////            throw new UsernameNotFoundException("用户名不存在");
////        }
////        // 自定义错误的文章说明的地址：http://blog.csdn.net/z69183787/article/details/21190639?locationNum=1&fps=1
////        if(user.getState().equalsIgnoreCase("0")){
////            throw new LockedException("用户账号被冻结，无法登陆请联系管理员！");
////        }
//        return null;
//    }
//}
